﻿<%--
 *  File:    VisitPlanEditOneDay.jsp
 *  @Author: ChinaLiu
 *  Date:    2009-10-19
 *
 *  Copyright (C) 2000 - 2009 Oval Technologies, Inc.
 *  All rights reserved. 
 *
 *  This software is the confidential and proprietary information of Oval 
 *  Technologies, Inc. ("Confidential Information").  You shall not
 *  disclose such Confidential Information and shall use it only in
 *  accordance with the terms of the license agreement you entered into
 *  with Oval.
--%>
<%@ include file="/inc/SessionTimeout.inc"%>
<%@ page language="java"%>
<%@ page import="java.util.*"%>
<%@ page import="org.apache.log4j.Category"%>


<%@ page contentType="text/html;charset=UTF-8"%>
<%@ taglib uri="/WEB-INF/PageFlow.tld" prefix="PageFlow"%>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic"%>

<%@ taglib uri="/WEB-INF/custom.tld" prefix="custom"%>

<%
  //init param
    String strModuleName = "SFE";
    String privilegeCode = "H0259,H0260";
  	String contextPath = request.getContextPath();
%>


<%@ include file="/inc/PageDefault.inc"%>
<%@ include file="/inc/LocationDefault.inc"%>
<html>
<head>
<iframe name="reloadHandler" style="display:none"></iframe>
<title>VisitPlanFeedbackOneDay</title>
<%
int nYear=0;
int nMonth=0;
int nWeek=0;
int nDay=0;
//System.out.print("year="+request.getParameter("year"));
//System.out.print("monthofyear="+request.getParameter("monthofyear"));
//System.out.print("weekofmonth="+request.getParameter("weekofmonth"));
//System.out.print("dayofweek="+request.getParameter("dayofweek"));
if(request.getParameter("year")!=null&&request.getParameter("year")!="")
{
	nYear=Integer.parseInt(request.getParameter("year"));
}
else if(session.getAttribute("year")!=null)
{
	nYear=((Integer)session.getAttribute("year")).intValue();
}
if(request.getParameter("monthofyear")!=null&&request.getParameter("monthofyear")!="")
{
	nMonth=Integer.parseInt(request.getParameter("monthofyear"));
}
else if(session.getAttribute("monthofyear")!=null)
{
	nMonth=((Integer)session.getAttribute("monthofyear")).intValue();
}
if(request.getParameter("weekofmonth")!=null&&request.getParameter("weekofmonth")!="")
{
	nWeek=Integer.parseInt(request.getParameter("weekofmonth"));
}
else if(session.getAttribute("weekofmonth")!=null)
{
	nWeek=((Integer)session.getAttribute("weekofmonth")).intValue();
}

if(request.getParameter("dayofweek")!=null&&request.getParameter("dayofweek")!="")
{
	nDay=Integer.parseInt(request.getParameter("dayofweek"));
}
else if(session.getAttribute("dayofweek")!=null)
{
	nDay=((Integer)session.getAttribute("dayofweek")).intValue();
}

Date planToday=null;
Date dWeekStart=null;
Date dWeekEnd=null;
String strplanToday="";
String strFullDateFormat=label.getLabelName("L_FullDateFormat");
int nStartDayWeekOfMonth=0;
Calendar cal=null;
if(nYear>0 && nMonth>0 && nWeek>0&&nDay>0)
{
	cal=Calendar.getInstance();
	cal.clear();
	cal.set(Calendar.YEAR, nYear);
	cal.set(Calendar.MONTH, nMonth-1);
	cal.set(Calendar.WEEK_OF_MONTH, nWeek);
	cal.setFirstDayOfWeek(Calendar.MONDAY);
	
	dWeekStart=cal.getTime();
	cal.set(Calendar.DAY_OF_WEEK, Calendar.SUNDAY);
	dWeekEnd=cal.getTime();
	session.setAttribute("weekstartdate",new java.sql.Date(dWeekStart.getTime()));
	session.setAttribute("weekenddate",new java.sql.Date(dWeekEnd.getTime()));
	//out.println(new java.sql.Date(dWeekStart.getTime()));
	//out.println(new java.sql.Date(dWeekEnd.getTime()));
	cal.set(Calendar.DAY_OF_WEEK, nDay);
	cal.add(Calendar.DATE, 1); 
	planToday=cal.getTime();
	if(nDay==1){
		planToday=dWeekStart;	
	}
	session.setAttribute("plandate",new java.sql.Date(planToday.getTime()));
	//out.println(new java.sql.Date(planToday.getTime()));
	nStartDayWeekOfMonth=cal.get(Calendar.WEEK_OF_MONTH);
	java.text.SimpleDateFormat sdf=new java.text.SimpleDateFormat(strFullDateFormat);
	strplanToday=sdf.format(planToday);
	
	
	
	
}
%>
<PageFlow:CheckPageFlow pageName="p_visitplanfeedbacketailone" />
<%@ include file="/inc/InitEdit.inc"%>
<%
java.util.HashMap userInfo = (java.util.HashMap)session.getAttribute("userinfo"); 
	java.util.HashMap contactinfo = (java.util.HashMap)pageContext.getAttribute("contactinfo"); 
	//System.out.print(contactinfo);
	if(contactinfo==null) contactinfo=new HashMap();
Integer nCurUserId = (Integer)userInfo.get("userid");
Integer nParentUserId = (Integer)contactinfo.get("parentuserid");
//	String leaderchange="";
//	leaderchange=(String)request.getParameter("leaderchange");


Integer contactid = null;
Integer outcount = new Integer(0);
//System.out.println("contactid1="+session.getAttribute("contactid"));
//System.out.println("contactid2="+Integer.valueOf(request.getParameter("contactid")));
 //System.out.println("contactid1="+request.getParameter("contactid"));
 if (request.getParameter("contactid") != null&&request.getParameter("contactid")!=""){
	 contactid = Integer.valueOf(request.getParameter("contactid"));
 }else {
	 contactid = (Integer)userInfo.get("userid");
 }
 //System.out.print("outcount="+outcount);
 if (request.getParameter("outcount") == null){
   if (session.getAttribute("outcount") != null){
	 outcount = (Integer)session.getAttribute("outcount");
   }
 }else {
	  outcount = Integer.valueOf(request.getParameter("outcount"));
 }
HashMap visitplaninfo=(HashMap)pageContext.getAttribute("visitplaninfo");
		if(visitplaninfo==null)
			visitplaninfo=new HashMap();
int nStatus=-1;
String strStatus="";
if(	visitplaninfo.get("status")!=null)
{
		nStatus=((Integer)	visitplaninfo.get("status")).intValue();
		strStatus=com.oval.util.OvalDictionaryEngine.getDictionaryValueName("Status",strLanguageCode,""+nStatus).getM_strValueName();
}
Vector vDetails=(Vector)pageContext.getAttribute("visitplandetails");	
		if(vDetails==null)
			vDetails=new Vector();
		
	if(	pageContext.getAttribute("contactid")!=null){
		contactid=(Integer)pageContext.getAttribute("contactid");
	}
	
%>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet"
	href="<%=contextPath%>/css/<%= strLanguageCode %>/main.css"
	type="text/css">
<script language="JavaScript"
	src="<%=contextPath%>/css/<%= strLanguageCode %>/script.js"></script>
<script language="JavaScript" src="<%=contextPath%>/js/ScriptLib.js"></script>
<script>
function page_finish(){
	refreshWindow();
}
function refreshWindow()
{
	var strUrl="VisitPlanFeedbackOneDay.jsp?ishistory=<custom:write property="ishistory"/>&contactid=<custom:write property="contactid"/>&orgid=<custom:write property="orgid"/>";
	strUrl=strUrl+"&year=<custom:write property="year"/>&monthofyear=<custom:write property="monthofyear"/>&weekofmonth=<custom:write property="weekofmonth"/>&dayofweek=<custom:write property="dayofweek"/>";
	strUrl=strUrl+"&<%= OvalTools.randomURL() %>";
	location.href=strUrl;

}
function page_save()
{
	var myform = eval("document.cform");
	//if(!checkForm(cform)) return;
	if(Number(myform.numrows.value)<1)
	 return;
	for(i=0;i<Number(myform.numrows.value);i++)
	{
		//var sstart=eval("myform.splanstarttime"+i);
		//var send=eval("myform.splanendtime"+i);
		//var tsstart=eval("myform.tsplanstarttime"+i);
		//var tsend=eval("myform.tsplanendtime"+i);
		var activityType=eval("myform.activitytype"+i).value;
		var dvisit=eval("myform.planvisitdate"+i);
		var processid=eval("myform.processid"+i);
		var uprocessid=eval("myform.uprocessid"+i);
	  if(activityType==1){
		if(isEmpty(processid.value) && isEmpty(uprocessid.value)){
  		   alert("<%=message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_VisitProcess"))%>");
  		   processid.focus();
  		   return;
  		}
  	  }
	<%--	if(isEmpty(tsstart.value))
			{
				alert("<%=message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_VisitPlanStartTime"))%>");
				return;
			}
			if(isEmpty(tsend.value))
			{
				alert("<%=message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_VisitPlanEndTime"))%>");
				return;
			}
			if(!isTime(tsstart.value,"HH:mm"))
			{
				alert("<%=message.getMessageDesc("ILLEGAL_FORMAT",label.getLabelName("L_VisitPlanStartTime"))%>(HH:mm)");
				return;
			
			}
			if(!isTime(tsend.value,"HH:mm"))
			{
				alert("<%=message.getMessageDesc("ILLEGAL_FORMAT",label.getLabelName("L_VisitPlanEndTime"))%>(HH:mm)");
				return;
			
			}
		sstart.value=dvisit.value+" "+tsstart.value+":00";
		send.value=dvisit.value+" "+tsend.value+":00";--%>
		
	}
		myform.actionname.value = "save";
 		myform.target="_self";
 		isRunning = true;
 		myform.submit();
}
function page_add(num)
{
	//var myform = eval("document.cform");
	var str1="";
	<%
	if(nStatus !=40){ 
	%>	
	str1="&plantype=1";
	<%}else{%>
	str1="&plantype=3&detailsstatus=40";
	<%}%>
	var strUrl="VisitPlanAddPopOneDay.jsp?contactid=<custom:write property="contactid"/>&orgid=<custom:write property="orgid"/>";
		strUrl=strUrl+"&year=<custom:write property="year"/>&monthofyear=<custom:write property="monthofyear"/>&weekofmonth=<custom:write property="weekofmonth"/>&dayofweek="+num;
		strUrl=strUrl+"&visitplanid=<custom:write property="visitplanid" name="visitplaninfo"/>&weekstart=<custom:write property="weekstartdate"/>&weekend=<custom:write property="weekenddate"/>";
		strUrl=strUrl+"&weekstartweekofmonth=<%=nStartDayWeekOfMonth%>&activitytype=1"+str1+"&<%= OvalTools.randomURL() %>";
    	
		 var status="height=500, width=1000,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no";
    if(popwindow!=null)
      popwindow.close();
   popwindow=window.open(strUrl, "addwindow", status);
}
function page_addother(num)
{
	
	var str1="";
	<%
	if(nStatus !=40){ 
	%>	
	str1="&plantype=1";
	<%}else{%>
	str1="&plantype=3&detailsstatus=40";
	<%}%>
	var myform = eval("document.cform");
		
	var strUrl="VisitPlanAddOtherPop.jsp?contactid=<custom:write property="contactid"/>&orgid=<custom:write property="orgid"/>";
		strUrl=strUrl+"&year=<custom:write property="year"/>&monthofyear=<custom:write property="monthofyear"/>&weekofmonth=<custom:write property="weekofmonth"/>&dayofweek="+num;
		strUrl=strUrl+"&visitplanid=<custom:write property="visitplanid" name="visitplaninfo"/>&weekstart=<custom:write property="weekstartdate"/>&weekend=<custom:write property="weekenddate" />";
		strUrl=strUrl+"&weekstartweekofmonth=<%=nStartDayWeekOfMonth%>&<%= OvalTools.randomURL() %>"+str1;
		 var status="height=130, width=450,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no";
    if(popwindow!=null)
      popwindow.close();
   popwindow=window.open(strUrl, "addwindow", status);
}
function page_delete()
{
	var myform = eval("document.cform");
	var details=eval("document.cform.detailids");
	var dflag="";
    for (var i=0; i<Number(document.cform.numrows.value);  i++)
  	{
  		var checkboxs =document.getElementById("detailids_"+<%=nDay%>+"_"+i);
  	     if(!checkboxs.disabled)
	  	   {
	  	     dflag=1;
	  	     break;
	  	   }
  	   
  	}
  if(dflag==1 || Number(document.cform.numrows.value)==0){
	if(isNullChecked(details))
    {
    alert("<%= message.getMessageDesc("MUST_SELECT_ONE_RECORD_TO_DEL") %>");
    return;
    }
   }else{
     alert("<%= message.getMessageDesc("INPUT_DEL_ONLY") %>");
     return;
   }
  var flag = confirm("<%= message.getMessageDesc("ARE_YOU_SURE_DEL") %>");
  if(!flag)
    return;
		myform.actionname.value = "delete";
 		myform.target="_self";
 		isRunning = true;
 		myform.submit();
}
function page_move(num)
{
	var myform = eval("document.cform");
	if(Number(myform.numrows.value)<1)
	 return;
	var details=eval("document.cform.detailids");
	if(isNullChecked(details))
  {
    alert("<%= message.getMessageDesc("MUST_SELECT_ONE_RECORD_TO_MOVE") %>");
    return;
  } 
  var ids ="";
 
  	for (var i=0; i<Number(myform.numrows.value);  i++)
  	{
  		var checkboxs = eval("myform.detailids_"+num+"_"+i);
  	    if(checkboxs.checked)
	  	   {
	  	   	if(ids=="")
	  	   	{
	  	   	ids=checkboxs.value;
	  	  
	  	   	}else{
	  	   	ids=ids+","+checkboxs.value;
	  	   
	  	   	}
	  	   }
  	   
  	}
	    var strUrl="VisitPlanMoveFrm.jsp?contactid=<custom:write property="contactid"/>&ids="+ids;
		strUrl=strUrl+"&year=<custom:write property="year"/>&monthofyear=<custom:write property="monthofyear"/>&weekofmonth=<custom:write property="weekofmonth"/>&dayofweek="+num;
		strUrl=strUrl+"&<%= OvalTools.randomURL() %>";
		 var status="height=500, width=800,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no";
    if(popwindow!=null)
      popwindow.close();
   popwindow=window.open(strUrl, "movewindow", status);
}
function page_submitforapproval()
{
    if(Number(<%=JspHelper.filterNull( vDetails.size() )%>) <= 0)
    {
      alert("<%= message.getMessageDesc("NO_BODY_INFO",label.getLabelName("L_VisitActivity",false)) %>");
      return;
    }
    if ( ! confirm("<%= message.getMessageDesc("ARE_YOU_SURE_TO_SUBMIT_APPROVE") %>") )  return;
  	document.cformoptions.actionname.value = "submitforapproval";
  	document.cformoptions.target = "_self";
  	isRunning = true;
  	document.cformoptions.submit();
}

function page_action(action)
{
  
  var details=eval("document.cform.detailids");
  if(isNullChecked(details))
  {
    alert("<%= message.getMessageDesc("MUST_SELECT_ONE_RECORD") %>");
    return;
  }
    
    var ids="";
	eval("document.cform.visitplandetailids").value=" ";
	alert(eval("document.cform.visitplandetailids").value);
    for (var i=0; i<Number(document.cform.numrows.value);  i++)
  	{
  		var checkboxs =document.getElementById("detailids_"+<%=nDay%>+"_"+i);
  	    if(checkboxs.checked)
	  	   {
	  	   	if(ids=="")
	  	   	{
	  	   	ids=checkboxs.value;
	  	  
	  	   	}else{
	  	   	ids=ids+","+checkboxs.value;
	  	   
	  	   	}
	  	   }
  	   
  	}
  	eval("document.cform.visitplandetailids").value=ids;
  if (action=="deny" || action == "agree")
  {
      if (action == "deny")
      {
        document.cform.actionname.value = "denysubmitweekplanapproval";
      }
      else if (action == "agree")
      {
        document.cform.actionname.value = "submitweekplanapproval";
      }
      isRunning = true;
	  document.cform.target="_self";
      isRunning = true;
 	  document.cform.submit();
  }
}
function page_submit()
{
  var details=eval("document.cform.detailids");
  if(isNullChecked(details))
  {
    alert("<%= message.getMessageDesc("MUST_SELECT_ONE_RECORD") %>");
    return;
  }
    
    var ids="";
	eval("document.cform.visitplandetailids").value=" ";
	alert(eval("document.cform.visitplandetailids").value);
    for (var i=0; i<Number(document.cform.numrows.value);  i++)
  	{
  		var checkboxs =document.getElementById("detailids_"+<%=nDay%>+"_"+i);
  	    if(checkboxs.checked)
	  	   {
	  	   	if(ids=="")
	  	   	{
	  	   	ids=checkboxs.value;
	  	  
	  	   	}else{
	  	   	ids=ids+","+checkboxs.value;
	  	   
	  	   	}
	  	   }
  	   
  	}
  	eval("document.cform.visitplandetailids").value=ids;
  	
    document.cform.actionname.value = "visitplansubmit";
    isRunning = true;
	document.cform.target="_self";
    isRunning = true;
 	document.cform.submit();
}
function page_add2day(num)
{
    <%
	if(nStatus !=40){ 
	%>	
	str1="&plantype=1";
	<%}else{%>
	str1="&plantype=3&detailsstatus=40";
	<%}%>
	var strUrl="VisitPlanAdd2DayTemplet.jsp?contactid=<custom:write property="contactid"/>&orgid=<custom:write property="orgid"/>&dayofweek="+num;
	strUrl=strUrl+"&year=<custom:write property="year"/>&monthofyear=<custom:write property="monthofyear"/>&weekofmonth=<custom:write property="weekofmonth"/>";
	strUrl=strUrl+"&visitplanid=<custom:write property="visitplanid" name="visitplaninfo"/>&weekstart=<custom:write property="weekstartdate"/>&weekend=<custom:write property="weekenddate"/>";
	strUrl=strUrl+"&weekstartweekofmonth=<%=nStartDayWeekOfMonth%>&activitytype=1"+str1+"&<%= OvalTools.randomURL() %>";
	
	var status="height=500, width=800,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=yes, location=no, status=no";
	if(popwindow!=null)
  	popwindow.close();
	opwindow=window.open(strUrl, "addwindow", status);
	 return;
	}

function page_selectedday(nyear,nmonth,nweek,nday,ndate,ndetailid,processid,uprocessid,globalpccode,flag)
	{
		 if((processid==null || processid=="") && (uprocessid==null || uprocessid=="")){
		   alert("<%=message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_VisitProcess"))%>");
		   return;
		 }
		 var strUrl="";
		 if(flag=="disabled"){
		    flag="isview";
		 }
        strUrl="ToVisitPlanFrm.jsp?ishistory=<custom:write property="ishistory"/>&customerid="+ndetailid+"&processid="+processid+"&uprocessid="+uprocessid+"&contactid=<custom:write property="contactid"/>&globalpccode="+globalpccode;
		strUrl=strUrl+"&year="+nyear+"&monthofyear="+nmonth+"&weekofmonth="+nweek+"&dayofweek="+nday+"&dayofmonth="+ndate+"&vflag="+flag;
		strUrl=strUrl+"&<%= OvalTools.randomURL() %>";
	    if(document.all){
         var gotoLink = document.createElement('a');
         gotoLink .href = strUrl;
         document.body.appendChild(gotoLink);
         gotoLink .click();
        }
        else self.location.href = strUrl;
	}
function page_other(nyear,nmonth,nweek,nday,ndate,visitplandetailid,activitytype,processid)
	{
		if(processid==null || processid==""){
		 alert("<%=message.getMessageDesc("VALUE_NOT_NULL",label.getLabelName("L_VisitProcess"))%>");
		 return;
		}
		var strUrl="";
        strUrl="OtherVisitPlanMain.jsp?ishistory=<custom:write property="ishistory"/>&visitplandetailid="+visitplandetailid+"&contactid=<custom:write property="contactid"/>";
		strUrl=strUrl+"&year="+nyear+"&monthofyear="+nmonth+"&weekofmonth="+nweek+"&dayofweek="+nday+"&dayofmonth="+ndate;
		strUrl=strUrl+"&<%= OvalTools.randomURL() %>";
	    if(document.all){
         var gotoLink = document.createElement('a');
         gotoLink .href = strUrl;
         document.body.appendChild(gotoLink);
         gotoLink .click();
        }
        else self.location.href = strUrl;
	}
function page_setUser(id,code,name){
	var rownum= document.cform.rownum.value;
	eval("document.cform.assistuserid"+rownum).value=id;
	eval("document.cform.assistusername"+rownum).value=code;
	eval("document.cform.assistemployeename"+rownum).value=name;
}

function page_selectUser(num) {
        document.cform.rownum.value=num;
        //alert(eval("document.cform.assistuserid"+num).value);
		var status = "height=400, width=600,top=100,left=100,toolbar=no, menubar=no, scrollbars=yes, resizable=no, location=no, status=no";
		var url = "<%=contextPath%>/sfe/UserSelectPop.jsp?businessareaid="+<%=userInfo.get("businessareaid")%>+"&contactid=<custom:write property="contactid"/>"+"&o_thread=" + Math.random();
			
		if (typeof popwindow != 'undefined') popwindow.close();
		popwindow = window.open(url, "newwindow2", status);
    }
function showPasswordinfo(){
	var flag = '';
	if(flag){
		var div = document.getElementById('assistdiv');
		div.style.display = 'block';	
	}
}
function showPassword(){
	var isusesystem = document.frm.isusesystem.value;
	if(isusesystem == 'Y'){
		document.frm.isusesystemflag.checked = 'checked';
		setPasswordTable();
	}
}
function clickCheckBox(obj){
    //alert(cform.numrows.value);
	if(cform.numrows.value >= 1){
		var j=0;
		for(var i=0;i<Number(cform.numrows.value);i++){
		   var idchk=document.getElementById('detailids_'+<%=nDay%>+"_"+j);
		   if(!idchk.disabled){
			if(idchk){
				idchk.checked=obj.checked;
			}
		   }
			j++;
		}
	}
}
function clearCheckFlag(obj){
	if(!obj.checked){
		cform.checkallbox.checked=false;
	}
}
function page_processview(v)
{
	//var seq =v.name.substr(v.name.length-1, v.name.length);
	var re = /[^0-9]/g;
	var seq = v.name.replace(re, '');
	var myform = eval("document.cform");
	var activitytype=eval("document.cform.activitytype"+seq).value;
	var contactid=document.cform.contactid.value;
	var  datahandler = new  DataHandler() ;
	datahandler.add_params("activitytype" , activitytype,"integer") ;
	datahandler.add_params("contactid" , contactid,"integer") ;
	datahandler.getResultFromVector("allprocesses","processname" ,"visitprocessid" ,"document.cform."+v.name) ;
	datahandler.add_job("j_zylvisitprocess") ;
	datahandler.runDataHandler ();
}
</script>
</head>
<%
if("Y".equals(request.getParameter("isconfirm"))){%>

<script>
	opener.refreshWindow();
</script>
<%return;
}%>
<body style="overflow: auto;">


<table cellSpacing="0" width="100%">
	<tr>
		<%
  	String[] weekLabelArrs=new String[]{"L_Monday","L_Tuesday","L_Wednesday","L_Thursday","L_Friday","L_Saturday","L_Sunday"};
		
	Calendar nowcal = Calendar.getInstance();
	
	Calendar  numcal = Calendar.getInstance();
	numcal.clear();
	numcal.set(Calendar.YEAR, nYear);
	numcal.set(Calendar.MONTH, nMonth - 1);
	numcal.set(Calendar.WEEK_OF_MONTH, nWeek);
	numcal.setFirstDayOfWeek(Calendar.MONDAY);
	numcal.add(Calendar.DAY_OF_WEEK, nDay-1);
	//out.print(new java.sql.Date(((Date)numcal.getTime()).getTime()));	
	
	Calendar firstweeknowcal = Calendar.getInstance();
	firstweeknowcal.clear();
	firstweeknowcal.set(Calendar.YEAR, nYear);
	firstweeknowcal.set(Calendar.MONTH, nMonth-1);
	firstweeknowcal.set(Calendar.WEEK_OF_MONTH, nWeek);
	firstweeknowcal.setFirstDayOfWeek(Calendar.MONDAY);
	//out.print(new java.sql.Date(((Date)firstweeknowcal.getTime()).getTime()));	
	int mondayPlus;
	Calendar nowfirstcal = Calendar.getInstance();
    //	 获得今天是一周的第几天，星期日是第一天，星期二是第二天......
	int dayOfWeek = nowfirstcal.get(Calendar.DAY_OF_WEEK) - 1; // 因为按中国礼拜一作为第一天所以这里减1
	if (dayOfWeek == 1) {
	  mondayPlus = 0;
	} else {
	  mondayPlus = 1 - dayOfWeek;
	}
	GregorianCalendar currentDate = new GregorianCalendar();
	currentDate.add(GregorianCalendar.DATE, mondayPlus);
	Date monday = currentDate.getTime();
	//out.print(new java.sql.Date(((Date)currentDate.getTime()).getTime()));	
		//int numCurr=0;
		HashMap oneDetailone=null;
		
  //	java.text.SimpleDateFormat sdf=new java.text.SimpleDateFormat(strFullDateFormat);
%>
		<td class="td-blue" width="84%"><%=label.getLabelName("L_VisitPlanDate")%><%=label.getLabelName("L_Colon")%>
		<%=strplanToday%>( <%if(nDay>0) {%> <%=label.getLabelName(weekLabelArrs[nDay-1])%><%} %>)
		</td>
		<td class="td-blue" width="16%" align="right"><%=label.getLabelName("L_Status")%><%=label.getLabelName("L_Colon")%>
		<%=strStatus%></td>

	</tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0" border="1">

	<tr valign="top">
		<td width="100%">
		<form name="cform" method="post" action="<%=contextPath%>/Dispatcher">
		<input type="hidden" name="pagename" value="p_visitplanfeedbacketailone">
		<input type="hidden" name="rownum">
		<input type="hidden" name="actionname">
		 <custom:hidden property="contactid" /> 
		 <custom:hidden property="orgid" />
		 <custom:hidden property="year" /> 
		 <custom:hidden property="monthofyear" /> 
		 <custom:hidden property="ishistory" />
		 <custom:hidden property="dayofweek" /> 
		 <custom:hidden property="weekofmonth" /> 
		 <custom:hidden property="visitplanid" name="visitplaninfo" />
		 <custom:hidden property="visitplandetailids"  />
		 <custom:hidden property="leaderchange" /> <%--   <custom:hidden property="weekstartdate" changedName="weekstart"/>
    <custom:hidden property="weekenddate" changedName="weekend"/>--%>
         <input type="hidden" name="weekstartweekofmonth" value="<%=nStartDayWeekOfMonth%>" />
		<table width="100%" cellspacing="0" cellpadding="0">
			<tr>
				<td>
				<table width="100%" cellspacing="0" cellpadding="0">
					<tr class="deepblue-left">
						<td class="td_right">&nbsp;
			 <% //out.print(nStatus);
	  if(nStatus ==40){ 
			if (nCurUserId.equals(contactid)) {
					//out.print(numcal.compareTo(firstweeknowcal)<0);		 		
					//out.print("numcal:"+numcal);
					//out.print(numcal.compareTo(firstweeknowcal)>0);
					/*
					out.print(new java.sql.Date(((Date)numcal.getTime()).getTime()));	//拜访日期
					out.print(new java.sql.Date(((Date)firstweeknowcal.getTime()).getTime()));//星期一	
					out.print(new java.sql.Date(((Date)nowcal.getTime()).getTime()));//当前日期
					out.print(new java.sql.Date(((Date)currentDate.getTime()).getTime()));//本星期第一天	
					*/
					//out.print(new java.sql.Date(((Date)firstweeknowcal.getTime()).getTime()));
					//out.print(new java.sql.Date(((Date)currentDate.getTime()).getTime()));
					//String strFullDateFormat=label.getLabelName("L_FullDateFormat");
					java.text.SimpleDateFormat vsdf=new java.text.SimpleDateFormat(strFullDateFormat);
					String d1_temp = vsdf.format(firstweeknowcal.getTime());
					String d2_temp = vsdf.format(currentDate.getTime());
					//out.println(d1_temp);out.println(d2_temp);
					//out.print(d1_temp.equals(d2_temp));
					if((numcal.compareTo(firstweeknowcal)>0 || numcal.compareTo(firstweeknowcal)==0) && (numcal.compareTo(nowcal)<0 || numcal.compareTo(nowcal)==0) && d1_temp.equals(d2_temp)){
						if(vDetails.size()>0){
					 %> <a onClick="page_add(<%=nDay %>)"><custom:button type="2"
							label="L_Add" imgsrc="back.gif" border="0" style="width:60" /></a>
						<a onClick="page_add2day(<%=nDay %>)"><custom:button type="2"
							label="L_AddByDay" imgsrc="back.gif" border="0" style="width:80" /></a>
						<a onClick="page_addother('<%=nDay%>')"><custom:button type="2"
							label="L_AddOther" imgsrc="back.gif" border="0" style="width:60" /></a>
						<a onClick="page_delete()"><custom:button type="2"
							label="L_Delete" imgsrc="back.gif" border="0" style="width:60" /></a>
						<a onClick="page_save()"><custom:button type="2" label="L_Save"
							imgsrc="back.gif" border="0" style="width:60" /></a>
					  <%}else if(vDetails.size()<=0){ %>
						<a onClick="page_add(<%=nDay %>)"><custom:button type="2"
							label="L_Add" imgsrc="back.gif" border="0" style="width:60" /></a>
						<a onClick="page_add2day(<%=nDay %>)"><custom:button type="2"
							label="L_AddByDay" imgsrc="back.gif" border="0" style="width:80" /></a>
						<a onClick="page_addother('<%=nDay%>')"><custom:button type="2"
							label="L_AddOther" imgsrc="back.gif" border="0" style="width:60" /></a>
						<%}
					}
				}else{
					     // if(JspHelper.filterNull( String.valueOf(nStatus)).equals("40")){
					    	  if(numcal.compareTo(nowcal)>0){
									if(vDetails.size()>0){
						 %> <a onClick="page_save()"><custom:button type="2"
								label="L_Save" imgsrc="back.gif" border="0" style="width:60" /></a>
						  <%   }
					    	//  }
					      }
				 }
			}%></td>
					</tr>
				</table>
				</td>
			</tr>
			<tr>
				<td>
				<table border="1" cellspacing="0" bordercolorlight="#999999"
					bordercolordark="#FFFFFF" cellpadding="0" width="100%">
					<tr class="deepblue-left">
						<td class="title_center" width="1%">
						<%if(vDetails.size() > 0){ %>
				        <input type="checkbox" name="checkallbox" class="checkbox"  onclick="clickCheckBox(this)">
			            <%}else{ %>
				        &nbsp;
			            <%} %>
						</td>
						<td class="title_center" width="15%"><%=label.getLabelName("L_PlanActivityTypeInfo")%></td>
						<td class="title_center" width="10%"><%=label.getLabelName("L_CustomervisitProgram")%></td>
          			    <td class="title_center" width="10%"><%=label.getLabelName("L_PeoplevisitProgram")%></td>
						<td class="title_center" width="5%"><%=label.getLabelName("L_LastVisitDate")%></td>
						<td class="title_center" width="5%"><%=label.getLabelName("L_CountVisitOfMonth")%></td>
						<td class="title_center" width="5%"><%=label.getLabelName("L_Dspotential")%></td>
						<td class="title_center" width="5%"><%=label.getLabelName("L_NeedAssist")%></td>
						<td class="title_center"  width="6%" ><%=label.getLabelName("L_Status")%></td>
						<%
                             //System.out.print("status="+visitplaninfo.get("status"));
							if( visitplaninfo!=null && (!visitplaninfo.isEmpty())&&((Integer)visitplaninfo.get("status")).intValue()==10) {
								%>

						<%} else{%>
						<td class="title_center" width="6%"><%=label.getLabelName("L_assistsatus")%></td>
						<td class="title_center" width="6%"><%=label.getLabelName("L_visitstatus")%></td>
						<td class="title_center"  width="6%" ><%=label.getLabelName("L_PlanType")%></td>
						<%} %>
						<td class="title_center" width="10%"><%=label.getLabelName("L_AssistUser")%></td>
						<td class="title_center" width="10%"><%=label.getLabelName("L_ByAssistUser")%></td>
					</tr>
					<% int seq=0;
          
          	if(nDay>0)
{ %>
					<logic:iterate id="oneDetail" collection="<%=vDetails%>"
						indexId="orderid">
						<%
          		
         

	          		oneDetailone=(HashMap)vDetails.get(seq);
	          		

   	
          		Date dPlanVisitDate=(Date)oneDetailone.get("planvisitdate");
          		
          		Calendar calPlanVisitDate=Calendar.getInstance();
          		java.text.SimpleDateFormat sdf2Str=new java.text.SimpleDateFormat("yyyy-MM-dd");
          		String sPlanVisitDate= sdf2Str.format(dPlanVisitDate);
          		dPlanVisitDate=sdf2Str.parse(sPlanVisitDate);
          		calPlanVisitDate.clear();
          		calPlanVisitDate.setTime(dPlanVisitDate);
          //		System.out.println("calPlanVisitDate="+calPlanVisitDate.getTime());
          	//	System.out.println("cal="+cal.getTime());
          		//if(calPlanVisitDate.compareTo(cal)==0)
          		//{
          			pageContext.setAttribute("onevisitdetail",oneDetailone);
          			java.text.SimpleDateFormat sdf2Time=new java.text.SimpleDateFormat("HH:mm");
          			Date dStart=(Date)oneDetailone.get("planstarttime");
          			Date dEnd=(Date)oneDetailone.get("planendtime");
          			String sStart="";
          			String sEdit="";
          			if(dStart!=null)
          				sStart=sdf2Time.format(dStart);
          			if(dEnd!=null)
          				sEdit=sdf2Time.format(dEnd);
          			String sAssistChecked	="";
          			if("Y".equals(oneDetailone.get("needassist")))
          				sAssistChecked="checked";
          			String strStyleClass="none";
          			if(seq%2==1)
          				strStyleClass="td-listrom";
          			String checkDisabled="";
          			String selectCheck="";
          				boolean selectDisabled=false;
          				String leaderchange=null;
          		if(request.getParameter("leaderchange")!=null)
          		{
          			leaderchange=(String)request.getParameter("leaderchange");
          		}else if(session.getAttribute("leaderchange")!=null)
          		{
          			leaderchange=(String)session.getAttribute("leaderchange");

          		}else if(pageContext.getAttribute("leaderchange")!=null)
          		{
          			leaderchange=(String)pageContext.getAttribute("leaderchange");
          			
          		}
          			if ("".equals(leaderchange)){
          				leaderchange = null;
          			}
          			/*
          			if(oneDetailone.get("changedid")!=null)
          			{
          				if(!nCurUserId.equals(oneDetailone.get("changedid"))) {
          					checkDisabled="disabled";
              				selectDisabled=true;
              				selectCheck="disabled";
          				}
          			}
          			if(oneDetailone.get("plandetailstatus")!=null)
          			{
          			   if(((Integer)oneDetailone.get("plandetailstatus")).intValue()==40)
          			   {
          				checkDisabled="disabled";
          				selectDisabled=true;
          				selectCheck="disabled";
          			   }
          			}*/
          		if(numcal.compareTo(nowcal)<0){
          			if(oneDetailone.get("plandetailstatus")!=null)
          			{
          			   if(((Integer)oneDetailone.get("plandetailstatus")).intValue()==40)
          			   {
          				checkDisabled="disabled";
          				selectDisabled=true;
          				selectCheck="disabled";
          			   }
          			}
          		}
          		if(oneDetailone.get("plantype")!=null)
      			{
      			   if(((Integer)oneDetailone.get("plantype")).intValue()==3)
      			   {
      				checkDisabled="";
      				selectDisabled=false;
      				selectCheck="";
      			   }
      			}
          		if(oneDetailone.get("visitstatus")!=null)
      			{
      			   if(((Integer)oneDetailone.get("visitstatus")).intValue()==2)
      			   {
      				checkDisabled="disabled";
      				selectDisabled=true;
      				selectCheck="disabled";
      			   }
      			}
          		if(oneDetailone.get("assistisaccept")!=null)
      			{
      			   if(((Integer)oneDetailone.get("assistisaccept")).intValue()==1)
      			   {
      				checkDisabled="disabled";
      				selectDisabled=true;
      				selectCheck="disabled";
      			   }
      			}
          		Integer oSeq=new Integer(seq);		
          			
          	%>
						<tr onClick="" class="<%=strStyleClass%>">
							<td height="12">
							<input type="checkbox" id="detailids_<%=nDay%>_<%=seq%>" <%=selectCheck%> name="detailids"
								value="<custom:write name="onevisitdetail" property="visitplandetailid" />"
								class="normalradio" onclick="clearCheckFlag(this)"> 
							<custom:hidden name="onevisitdetail"
								property="visitplandetailid" colIndex="<%=oSeq%>" /> <custom:hidden
								name="onevisitdetail" property="planvisitdate"
								colIndex="<%=oSeq%>" /> <input type="hidden"
								name="splanstarttime<%=seq%>" /> <input type="hidden"
								name="splanendtime<%=seq%>" /> <custom:hidden
								name="onevisitdetail" property="needassist" colIndex="<%=oSeq%>" />
							<custom:hidden name="onevisitdetail" property="changedid"
								colIndex="<%=oSeq%>" /></td>
							<td><%pageContext.setAttribute("displayflag","view");%> 
							<% 
							Integer activityType=(Integer)oneDetailone.get("activitytype");
							if(activityType.intValue()==1 || activityType.intValue()==2){%>
							<custom:selectdic name="onevisitdetail" property="activitytype" dictType="ZVisitProcessType" /> 
							<%} %>
							<custom:hidden name="onevisitdetail" property="activitytype" colIndex="<%=oSeq%>"></custom:hidden>
							<%
							String disabledByActivityType="";
							boolean isDisabledByActivityType=false;
							if(activityType.intValue()==1){
							%>
							<a onClick="javascript:page_selectedday('<custom:write name="onevisitdetail" property="year"/>','<custom:write name="onevisitdetail" property="monthofyear"/>','<custom:write name="onevisitdetail" property="weekofmonth" />','<custom:write name="onevisitdetail" property="dayofweek" />','<custom:write name="onevisitdetail" property="planvisitdate" />','<custom:write name="onevisitdetail" property="customerid" />','<custom:write name="onevisitdetail" property="processid" />','<custom:write name="onevisitdetail" property="uprocessid" />','<custom:write name="onevisitdetail" property="globalpccode" />','<%=selectCheck%>');">
							( <custom:write name="onevisitdetail" property="customercode" nbsp="true" /> &nbsp; 
							<custom:write name="onevisitdetail" property="customername" nbsp="true" /> &nbsp; 
							<custom:selectdic name="onevisitdetail" property="globalpccode" dictType="GlobalPCCode" /> )
							</a> 
						    <%}else{
						        
						       if(activityType.intValue()==2){
						    	 disabledByActivityType="disabled";
							     isDisabledByActivityType=true;
							     selectDisabled=true;
						       }else{
						    %>
						    <a onclick="javascript:page_other('<custom:write name="onevisitdetail" property="year"/>','<custom:write name="onevisitdetail" property="monthofyear"/>','<custom:write name="onevisitdetail" property="weekofmonth" />','<custom:write name="onevisitdetail" property="dayofweek" />','<custom:write name="onevisitdetail" property="planvisitdate" />','<custom:write name="onevisitdetail" property="visitplandetailid" />','<custom:write name="onevisitdetail" property="activitytype" />','<custom:write name="onevisitdetail" property="processid" />');" >
							 <custom:selectdic name="onevisitdetail" property="activitytype" dictType="ZVisitProcessType" /> 
							</a>
						    <% 
						       }
							%> 
							<%}
							pageContext.setAttribute("displayflag","");
							%>&nbsp;</td>
							<!--td><a onclick=""><custom:write name="onevisitdetail" property="customercode" nbsp="true"/></a></td>
							<td><input type="text" size="6" name="tsplanstarttime<%=seq%>" <%=checkDisabled%> value="<%=sStart%>" /></td>
							<td><input type="text" size="6" name="tsplanendtime<%=seq%>" <%=checkDisabled%> value="<%=sEdit%>"  /></td>
							<td><custom:write name="onevisitdetail" property="customershortname" nbsp="true" /></td>
							<td><custom:write name="onevisitdetail" property="globalpcname" nbsp="true"/></td-->
							
							<%if(activityType.intValue()==1){ %>
							<td><custom:select name="onevisitdetail" property="processid" disabled="<%=selectDisabled%>" optionsName="customprocesses" optionValueKey="visitprocessid" optionInnerTextKey="processname"	colIndex="<%=oSeq%>" defaultValue="---" defaultValueCost=" " /></td>
							<td>&nbsp;
							<custom:select name="onevisitdetail" property="uprocessid" disabled="<%=selectDisabled%>" optionsName="doctorprocesses" optionValueKey="visitprocessid" optionInnerTextKey="processname"	colIndex="<%=oSeq%>" defaultValue="---" defaultValueCost=" " />
							<%}else{ %>
							<%
							 Vector  activityprocesses = (Vector) pageContext.getAttribute("activityprocesses");
							 Vector otherprocesses=new Vector();
							 if(activityprocesses == null)  activityprocesses = new Vector();
							 for(int e=0;e<activityprocesses.size();e++){
								 if(((Integer)((HashMap)activityprocesses.get(e)).get("visitprotype")).equals(activityType) || ((Integer)((HashMap)activityprocesses.get(e)).get("visitprotype")).intValue()==0){
									 otherprocesses.add(((HashMap)activityprocesses.get(e)));
								 }
							 }	 
							 pageContext.setAttribute("otherprocesses",otherprocesses);
							%>
							<td><custom:select name="onevisitdetail" property="processid" disabled="<%=selectDisabled%>" optionsName="otherprocesses" optionValueKey="visitprocessid" optionInnerTextKey="processname"	colIndex="<%=oSeq%>" defaultValue="---" defaultValueCost=" " /></td>
							<td>&nbsp;</td>
							<%} %>
							</td>
							<td><custom:write name="onevisitdetail" property="lastvisitdate" nbsp="true" /></td>
							<td><custom:write name="onevisitdetail" property="count_org"
								nbsp="true" /></td>
							<td><custom:write name="onevisitdetail" property="dspotential"
								nbsp="true" /></td>
							<custom:hidden name="onevisitdetail" property="customerid"
								colIndex="<%=oSeq%>" />
							<td><input type="checkbox" <%=disabledByActivityType%>
								name="showneedassist<%=seq%>" <%=checkDisabled%> value="Y"
								<%=sAssistChecked%> class="normalradio"
								onclick="javascript:page_needassist('<%=seq%>')"></td>
							<td><custom:write property="plandetailstatus" name="onevisitdetail" dictType="Status" nbsp="true"/>
							<%
							if( visitplaninfo!=null && (!visitplaninfo.isEmpty())&&((Integer)visitplaninfo.get("status")).intValue()==10) {
								%>

							<%} else{%>
							<td><custom:write property="assistisaccept" name="onevisitdetail"
								dictType="AssistAcceptStatus" nbsp="true" /></td>
							<td><custom:write property="visitstatus" name="onevisitdetail"
								dictType="VisitStatus" nbsp="true" /></td>
						  <custom:hidden   name="onevisitdetail" property="plantype"  colIndex="<%=oSeq%>"/></td>
	                      <td><custom:write property="plantype" name="onevisitdetail" dictType="PlanType" nbsp="true"/>
							<%} %>
							<td>&nbsp;
							 <div id="assistdiv<%=oSeq%>" >
							 <% if(("checked").equals(sAssistChecked)){
							  if(selectDisabled!=true){%>
							 <custom:text name="onevisitdetail" property="assistusername" size="10" colIndex="<%=oSeq%>"/>
							 <a onclick="javascript:page_selectUser(<%=seq%>);">
							 <custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0" />
							 </a>
							 <custom:text name="onevisitdetail" property="assistemployeename" size="10" colIndex="<%=oSeq%>"/>
							 <%}else{ %>
							      <custom:write name="onevisitdetail" property="assistusername"/>&nbsp;<custom:write name="onevisitdetail" property="assistemployeename"/>
							 <%}}else{ %>
							 <custom:text name="onevisitdetail" property="assistusername" size="10" colIndex="<%=oSeq%>"/>
							 <a onclick="javascript:page_selectUser(<%=seq%>);">
							 <custom:button type="3" label="L_Asterisk" imgsrc="flash.gif" border="0" />
							 </a>
							 <custom:text name="onevisitdetail" property="assistemployeename" size="10" colIndex="<%=oSeq%>"/>
							 <%} %>
							 </div>
							  <custom:hidden name="onevisitdetail" property="assistuserid" colIndex="<%=oSeq%>"/>
							</td>
							<td>&nbsp; <custom:write name="onevisitdetail" property="byassistusername"  /> &nbsp;<custom:write name="onevisitdetail" property="byassistemployeename"  /></td>
						</tr>
						<%
						seq++;
						
					//	}
		
						 %>
					</logic:iterate>
					<%} %>
				</table>
				<input type="hidden" name="numrows" value="<%=seq%>" /></td>
			</tr>

		</table>
		</form>
		</td>

	</tr>
</table>
<table width="100%" cellspacing="0" cellpadding="0">
	<tr>
		<td class="summary_top"></td>
	</tr>
	<tr>
		<td class="td_center">
		<!--  <a onclick="page_finish()"><custom:button type="1" label="L_Finish" imgsrc="back.gif" border="0" style="width:60" /></a>-->
 <% //System.out.print("nParentUserId="+nParentUserId);
 if(outcount.intValue()!=0){
		if (nCurUserId.equals(nParentUserId)) { 
		 %>
		<!-- <a onclick="page_action('agree')"><custom:button type="1" label="L_Agree" imgsrc="Agree.gif" border="0" style="width:60"/></a> -->
		<!--<a onclick="page_action('deny')"><custom:button type="1" label="L_Deny" imgsrc="no_agree.gif" border="0" style="width:60"/></a> -->
		<%}
		//out.println(nCurUserId);out.println(contactid);
		if (nCurUserId.equals(contactid)) { 
%>
        <!--<a onclick="page_submit()"><custom:button type="1" label="L_Submit" imgsrc="no_agree.gif" border="0" style="width:60"/></a>  -->        
<%
		}
}%>
<a onclick="window.opener.location.reload(); "><custom:button type="1" label="L_Back" imgsrc="no_agree.gif" border="0" style="width:60"/></a>   
	    </td>
	</tr>
</table>
<script>
  <%
  java.util.HashMap parentuserinfo = (java.util.HashMap)pageContext.getAttribute("parentuserinfo"); 
  %>
  for(var i=0;i<<%=vDetails.size()%>;i++){
    if(eval("document.cform.needassist"+i).value=="Y"){
        var div = document.getElementById("assistdiv"+i); 
		div.style.display = 'block';
		<%
		if (parentuserinfo!=null) {
		%>
		 if(isEmpty(eval("document.cform.assistuserid"+i).value)){
		  eval("document.cform.assistuserid"+i).value="<%=parentuserinfo.get("assistuserid")%>";
		  eval("document.cform.assistusername"+i).value="<%=parentuserinfo.get("assistusername")%>";
		  eval("document.cform.assistemployeename"+i).value="<%=parentuserinfo.get("assistemployeename")%>";
		 }
		<%
		}
	    %>
    }else{
        var ndiv = document.getElementById("assistdiv"+i); 
		ndiv.style.display = 'none';
    }
  }
  function page_needassist(seq)
{
	var myform = eval("document.cform");
	var sneedassist=eval("myform.showneedassist"+seq);
	var needassist=eval("myform.needassist"+seq);
	var changedid = eval("myform.changedid"+seq);
	var leaderchange = eval("myform.leaderchange");
	var div = document.getElementById("assistdiv"+seq); 
	if(sneedassist.checked)
	{
		needassist.value="Y";
		if(leaderchange.value!=null){
		changedid.value="<%=nCurUserId%>";
		}
		div.style.display = 'block';
		<%
		if (parentuserinfo!=null) {
		%>
		 if(isEmpty(eval("document.cform.assistuserid"+seq).value)){
		  eval("document.cform.assistuserid"+seq).value="<%=parentuserinfo.get("assistuserid")%>";
		  eval("document.cform.assistusername"+seq).value="<%=parentuserinfo.get("assistusername")%>";
		  eval("document.cform.assistemployeename"+seq).value="<%=parentuserinfo.get("assistemployeename")%>";
		 }
		<%
		}
	    %>	
	}
	else{
		needassist.value="N";
		eval("myform.assistuserid"+seq).value=" ";
		changedid.value=" ";	
		div.style.display = 'none';
	}
}
</script>
</body>
</html>

